/****************************************************************************
 *   This file is part of Q2D.                                              *
 *                                                                          *
 *   Q2D is free software: you can redistribute it and/or modify            *
 *   it under the terms of the GNU General Public License as published by   *
 *   the Free Software Foundation, either version 3 of the License, or      *
 *   (at your option) any later version.                                    *
 *                                                                          *
 *   Q2D is distributed in the hope that it will be useful,                 *
 *   but WITHOUT ANY WARRANTY; without even the implied warranty of         *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the          *
 *   GNU General Public License for more details.                           *
 *                                                                          *
 *   You should have received a copy of the GNU General Public License      *
 *   along with Q2D.  If not, see <http://www.gnu.org/licenses/>.           *
 *                                                                          *
 ****************************************************************************/

#ifndef WEAPON_H
#define WEAPON_H

#include <QtCore/QVariant>
#include <QtCore/QString>
#include <QtCore/QCryptographicHash>
#include "weapondamagetype.h"
#include "weapontype.h"

class Weapon
{

public:
    Weapon();
    uint getId();
    void setId(uint id);
    QString getHexHash() const;
    QString getName();
    void setName(QString name);
    QString getDescription();
    void setDescription(QString description);
    WeaponType * getWeaponType();
    void setWeaponType(WeaponType type);
    qreal getPrice();
    void setPrice(qreal price);
    QString getDamageSmall();
    void setDamageSmall(QString damage);
    QString getDamageMedium();
    void setDamageMedium(QString damage);
    uint getCriticalFactor();
    void setCriticalFactor(uint factor);
    uint getCriticalRange();
    void setCriticalRange(uint range);
    qreal getRange();
    void setRange(qreal range);
    qreal getWeight();
    void setWeight(qreal weight);
    WeaponDamageType * getDamageType();
    void setWeaponDamageType(WeaponDamageType type);
    int getBaBonus();
    void setBaBonus(int bonus);
    int getDmgBonus();
    void setDmgBonus(int bonus);

    bool operator==(const Weapon &w) const;

private:
    uint id;
    QCryptographicHash * hash;
    QString name;
    QString description;
    WeaponType type;
    qreal price;
    QString damageSmall;
    QString damageMedium;
    uint criticalFactor;       // critical dmg factor 2=x2,3=x3 etc
    uint criticalRange;        // critical dmg range 0 ->, 1-> 19-20, 2-> 18-20 etc
    qreal range;
    qreal weight;
    WeaponDamageType damageType;       // perforant / tranchant, etc..
    int baBonus;
    int dmgBonus;

protected:

};

Q_DECLARE_METATYPE(Weapon)

#endif // WEAPON_H
